package com.pocketpets.main;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.Toast;

import com.app.pocketpets.R;
import com.pocketpets.service.petdata.PetDataAdapter;
import com.pocketpets.service.petdata.PetDataFactory;

public class PetListActivity extends ListActivity {

	// ================================================================
	// Inherited methods
	// ================================================================

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.pet_list);

		PetDataAdapter petData = PetDataFactory.makePetDataAdapter(this);
		setListAdapter(petData);
		getListView().setTextFilterEnabled(true);
	}

	public void onListItemClick(ListView parent, View v, int position, int id) {
		Toast.makeText(getApplicationContext(),
				String.format("The %dth item is click", position),
				Toast.LENGTH_SHORT).show();
	}

}